﻿<%@ Page Title="" Language="C#" MasterPageFile="~/HospitalCare.Master" AutoEventWireup="true"
    CodeBehind="NurseSchedule.aspx.cs" Inherits="MedicalCare.NurseSchedule" %>

<%--<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxToolkit" %>--%>
<%--<%@ Register Src="~/UserControls/FileUploadControls.ascx" TagPrefix="fileUpload" TagName="Image" %>--%>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
    <script src="Scripts/jquery/jquery-1.4.1.js" type="text/javascript"></script>
    <script src="Scripts/js/Comment.js" type="text/javascript"></script>
    <link href="Styles/schedule.css" rel="stylesheet" type="text/css" />
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <%-- <asp:TextBox ID="tbScheduleDateFrom" Width="80px" runat="server"></asp:TextBox>
    <ajaxToolkit:CalendarExtender ID="CalendarExtender1" TodaysDateFormat="" TargetControlID="tbScheduleDateFrom" runat="server">
    </ajaxToolkit:CalendarExtender>
    到
     <asp:TextBox ID="tbScheduleDateTo" Width="80px"  runat="server"></asp:TextBox>
    <ajaxToolkit:CalendarExtender ID="CalendarExtender2" TargetControlID="tbScheduleDateTo" runat="server">
    </ajaxToolkit:CalendarExtender>
    <asp:Button ID="btnSearch" runat="server" Text="查询" />--%>
    <table>
        <tr>
            <td style="vertical-align: top;">
                <asp:Calendar ID="CalendarSchedule" runat="server" BackColor="White" BorderColor="#999999"
                    CellPadding="4" DayNameFormat="Shortest" Font-Names="Verdana" Font-Size="8pt"
                    ForeColor="Black" Height="180px" OnDayRender="CalendarSchedule_DayRender" OnSelectionChanged="CalendarSchedule_SelectionChanged"
                    Width="200px">
                    <DayHeaderStyle BackColor="#CCCCCC" Font-Bold="True" Font-Size="7pt" />
                    <NextPrevStyle VerticalAlign="Bottom" />
                    <OtherMonthDayStyle ForeColor="#808080" />
                    <SelectedDayStyle BackColor="#666666" Font-Bold="True" ForeColor="White" />
                    <SelectorStyle BackColor="#CCCCCC" />
                    <TitleStyle BackColor="#999999" BorderColor="Black" Font-Bold="True" />
                    <TodayDayStyle BackColor="#CCCCCC" ForeColor="Black" />
                    <WeekendDayStyle BackColor="#FFFFCC" />
                </asp:Calendar>
            </td>
            <td style="vertical-align: top;">
                <asp:DataList ID="ScheduleList" runat="server" OnItemCommand="ScheduleList_ItemCommand"
                    CellPadding="2" ForeColor="#333333" OnItemDataBound="ScheduleList_ItemDataBound">
                    <%--<AlternatingItemStyle BackColor="White" ForeColor="#284775" />--%>
                    <FooterStyle BackColor="#5D7B9D" ForeColor="White" Font-Bold="True" />
                    <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                    <%--<ItemStyle BackColor="#F7F6F3" ForeColor="#333333" />--%>
                    <HeaderTemplate>
                        <table cellpadding="2" cellspacing="0" border="0">
                            <tr>
                                <td style="width: 100px; text-align: center">
                                    姓名
                                </td>
                                <td style="width: 200px; text-align: center">
                                    家庭住址
                                </td>
                                <td style="width: 100px; text-align: center">
                                    护理时间
                                </td>
                                <td style="width: 100px; text-align: center">
                                    详细
                                </td>
                            </tr>
                        </table>
                    </HeaderTemplate>
                    <ItemTemplate>
                        <table cellpadding="2" cellspacing="0" border="0">
                            <tr onmouseover="this.style.background ='#FFDEAD';" onmouseout="this.style.background ='#ffffff'">
                                <td style="width: 100px">
                                    <%# DataBinder.Eval(Container.DataItem, "FamilyName")%>
                                </td>
                                <td style="width: 200px">
                                    <%# DataBinder.Eval(Container.DataItem, "Address")%>
                                </td>
                                <td style="width: 40px; text-align: center">
                                    <%# ToTime(DataBinder.Eval(Container.DataItem, "StartDT")) %>
                                </td>
                                <td style="width: 20px; text-align: center">
                                    -
                                </td>
                                <td style="width: 40px; text-align: center">
                                    <%# ToTime(DataBinder.Eval(Container.DataItem, "EndDT")) %>
                                </td>
                                <td style="width: 100px; text-align: center">
                                    <asp:LinkButton ID="btnView" runat="server" Text="查看" CommandName="VIEW" CommandArgument='<%# DataBinder.Eval(Container.DataItem, "Id") %>' />
                                </td>
                            </tr>
                        </table>
                    </ItemTemplate>
                    <SelectedItemStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
                </asp:DataList>
            </td>
        </tr>
    </table>
    <br />
    <asp:UpdatePanel ID="updatePanelEquipments" runat="server">
        <ContentTemplate>
            <asp:Panel ID="panelScheduleDetails" GroupingText="详细信息" runat="server" Visible="false">
                <input id="hiddenScheduleId" runat="server" type="hidden" />
                <table>
                    <tr>
                        <td class="scheduledetail">
                            病人姓名:
                        </td>
                        <td>
                            <asp:Label ID="lbDamilyName" runat="server" Text=""></asp:Label>
                        </td>
                    </tr>
                    <tr>
                        <td class="scheduledetail">
                            病人电话:
                        </td>
                        <td>
                            <asp:Label ID="LbFamilyPhone" runat="server" Text="1872123000暂缺字段"></asp:Label>
                        </td>
                    </tr>
                    <tr>
                        <td class="scheduledetail">
                            使用设备
                        </td>
                        <td>
                            <div>
                                <asp:Repeater ID="repeaterEquipments" runat="server" OnItemDataBound="repeaterEquipments_ItemDataBound"
                                    OnItemCommand="repeaterEquipments_ItemCommand">
                                    <ItemTemplate>
                                        <br />
                                        <asp:Label ID="lbIndex" runat="server" Text=' <%# DataBinder.Eval(Container.DataItem, "Index") %>'
                                            Visible="false" />
                                        <asp:Label ID="lbEquipmentTypeId" runat="server" Text=' <%# DataBinder.Eval(Container.DataItem, "EquipmentTypeId") %>'
                                            Visible="false" />
                                        <asp:DropDownList runat="server" ID="ddlEquipmentsType" DataValueField="Id" DataTextField="Name">
                                        </asp:DropDownList>
                                        <asp:TextBox ID="tbEquipmentSensorId" runat="server" Text=' <%# DataBinder.Eval(Container.DataItem, "EquipmentSensorId") %>'></asp:TextBox>
                                        <asp:Button runat="server" Text="删除" ID="btnRemoveEquipment" CommandName="REMOVE"
                                            CommandArgument=' <%# DataBinder.Eval(Container.DataItem, "Index") %>'></asp:Button>
                                    </ItemTemplate>
                                </asp:Repeater>
                                <asp:LinkButton runat="server" ID="lbtnAddEquipement" OnClick="lbtnAddEquipement_Click">添加设备</asp:LinkButton>
                            </div>
                    </tr>
                    <tr>
                        <td class="scheduledetail"> 
                          任务状态：
                        </td>
                        <td>
                            <asp:DropDownList ID="ddlScheduleStatus" runat="server">
                            </asp:DropDownList>
                            <asp:Button ID="btnSave" runat="server" Text="确定" OnClick="btnSave_Click" />
                        </td>
                    </tr>
                </table>
            </asp:Panel>
        </ContentTemplate>
    </asp:UpdatePanel>
    <asp:UpdatePanel ID="updatePanelComments" runat="server">
        <ContentTemplate>
            <%-- <asp:Button ID="Button1" runat="server" Text="Button" /> 
    <ajaxToolkit:CollapsiblePanelExtender ID="CollapsiblePanelExtender1"
     TargetControlID="panelComments" CollapsedText="注释" CollapseControlID="Button1" ExpandControlID="Button1" runat="server">
    </ajaxToolkit:CollapsiblePanelExtender>--%>
            <asp:Panel ID="panelComments" runat="server" Visible="false" GroupingText="讨论区">
                <asp:Repeater ID="repeaterComments" runat="server">
                    <ItemTemplate>
                        <table border="0">
                            <tr>
                                <td style="font-weight: bold" colspan="2">
                                    <%# DataBinder.Eval(Container.DataItem, "Comment") %>
                                    <br />
                                    <img src="<%#DataBinder.Eval(Container.DataItem, "ImagePath") %>" />
                                    <asp:LinkButton ID="vedioDownload" runat="server" Text="视频下载" Visible="true"></asp:LinkButton>
                                </td>
                            </tr>
                            <tr>
                                <td style="font-size: smaller; color: Gray">
                                    <%# DataBinder.Eval(Container.DataItem, "CreateDT") %>
                                    &nbsp; &nbsp;来自于
                                    <%# DataBinder.Eval(Container.DataItem, "UserName") %>
                                </td>
                                <td style="padding-left: 20px">
                                    <a href="javascript:void(0);" onclick="ShowReplyDiv('<%# DataBinder.Eval(Container.DataItem, "Id").ToString()%>');">
                                        评论</a>
                                </td>
                            </tr>
                            <tr>
                                <td colspan="2">
                                    <div id='ReplyCommentList_<%# DataBinder.Eval(Container.DataItem, "Id").ToString()%>'
                                        style="display: none">
                                        <div>
                                            <textarea id="replyCommentContent_<%# DataBinder.Eval(Container.DataItem, "Id").ToString()%>"></textarea>
                                            <input type="button" value="确认" style="width: 50px" onclick="ReplyCommentSend('<%# DataBinder.Eval(Container.DataItem, "Id").ToString()%>')" />
                                        </div>
                                        <div id="DivReplyCommentContent_<%# DataBinder.Eval(Container.DataItem, "Id").ToString()%>"
                                            style="display: none">
                                        </div>
                                    </div>
                                </td>
                            </tr>
                        </table>
                        <hr style="height: 1px; color: #E6E6E6" />
                    </ItemTemplate>
                </asp:Repeater>
                <%--   
                 <asp:TextBox ID="tbCommment" runat="server" Rows="5" Width="305px"></asp:TextBox>
                 <asp:Button ID="btnAddComment" runat="server" Text="发表" 
                     onclick="btnAddComment_Click"  />--%>
            </asp:Panel>
        </ContentTemplate>
    </asp:UpdatePanel>
    <asp:Panel ID="panelCommentSumit" Visible="false" runat="server" GroupingText="发表">
        <table>
            <tr>
                <td>
                    内容：
                </td>
                <td>
                    <asp:TextBox ID="tbCommment" runat="server" Rows="5" Width="305px"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td>
                    图片：
                </td>
                <td>
                    <input type="file" name="uploadPic" id="uploadPic" runat="server" />
                </td>
            </tr>
            <tr>
                <td>
                    视频：
                </td>
                <td>
                    <input type="file" name="uploadVedio" id="uploadVedio" runat="server" />
                </td>
            </tr>
            <tr>
                <td colspan="2">
                    <asp:Button ID="Button1" runat="server" Text="提交" OnClick="btnAddComment_Click" />
                    <asp:Label ID="lblMessage" runat="server"></asp:Label>
                </td>
            </tr>
        </table>
    </asp:Panel>
</asp:Content>
